﻿using DAL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace DianShang.Controllers
{
    public class GouWuCheController : Controller
    {
        // GET: GouWuChe
        public ActionResult Index()
        {
            using (ShopContext db = new ShopContext())
            {
                if(Session["login"] == null)
                {
                    TempData["msg"] = "老弟，你需要先登录";
                    return Redirect("/Home/Login");
                }
                else
                {
                    var l = ((Customer)Session["login"]).Id;
                    ViewBag.name = ((Customer)Session["login"]).CustomerName;
                    var list = db.V_ShopCart.ToList();
                    return View(list);
                }
            }
        }
    }
}